<template>
  <div class="search">
    <f-form ref="form" :action="api.jingtu" :form-key="this.formItem.undefined" >
      <f-form-item label="第三方流水号"  name="thirdSerialId" dataType="${formField.dataType}"   :value="formItem.thirdSerialId" />
      <f-form-item label=""  name="roomId" dataType="${formField.dataType}"   :value="formItem.roomId" />
      <f-form-item label="贵宾厅名称"  name="RoomName" dataType="${formField.dataType}"   :value="formItem.RoomName" />
      <f-form-item label="贵宾厅地址"  name="address" dataType="${formField.dataType}"   :value="formItem.address" />
      <f-form-item label=""  name="businessHours" dataType="${formField.dataType}"   :value="formItem.businessHours" />
      <f-form-item label="预约使用人姓名"  name="contactName" dataType="${formField.dataType}"   :value="formItem.contactName" />
      <f-form-item label="预约使用人联系电话"  name="contactPhone" dataType="${formField.dataType}"   :value="formItem.contactPhone" />
      <f-form-item label=""  name="productUniqueCode" dataType="${formField.dataType}"   :value="formItem.productUniqueCode" />
      <f-form-item label=""  name="buyCount" dataType="number"   :value="formItem.buyCount" />
      <f-form-item label="发车时间"  name="startTime" dataType="${formField.dataType}"   :value="formItem.startTime" />
      <f-form-item label="身份证号"  name="cardNo" dataType="${formField.dataType}"   :value="formItem.cardNo" />
      <f-form-item label="列车号"  name="batchNo" dataType="${formField.dataType}"   :value="formItem.batchNo" />
      <f-form-item label="行程"  name="trip" dataType="${formField.dataType}"   :value="formItem.trip" />
      <f-form-item label="预约状态（1待预约，2预约成功，3预约失败）"  name="state" dataType="number"   :value="formItem.state" />
      <f-form-item label="贵宾厅订单号"  name="serialId" dataType="${formField.dataType}"   :value="formItem.serialId" />
      <f-form-item label="验证码"  name="ticketNo" dataType="${formField.dataType}"   :value="formItem.ticketNo" />
      <f-form-item label="创建日期"  name="createDate" dataType="${formField.dataType}"   :value="formItem.createDate" />
    </f-form>
  </div>
</template>
<script>
  import api from './js/api'
  export default {
    name: 'jingtuForm',
    props: {},
    data() {
      return {
        refs:this.$refs,
        api:  Object.assign(api, this.api),
        isAdd: true,//是否是添加模式
        loaded: false,//是否加载完成
        formItem: this.getFormItem()
      }
    },
    methods: {
      getFormItem() {
        return {
          undefined: '',
          thirdSerialId: '',
          roomId: '',
          RoomName: '',
          address: '',
          businessHours: '',
          contactName: '',
          contactPhone: '',
          productUniqueCode: '',
          buyCount: '',
          startTime: '',
          cardNo: '',
          batchNo: '',
          trip: '',
          state: '',
          serialId: '',
          ticketNo: '',
          createDate: ''
        }
      },
      //表单赋值
      setData(data) {
        this.$refs.form.resetFields()
        this.formItem = this.getFormItem()
        if (data && data.undefined) {
          let params={
              undefined:data.undefined
          }
          this.refs['form'].getDetails(params,(data)=>{
             this.formItem=data
             this.loaded = true
          })
          this.isAdd = false
        } else {
          this.loaded = true
        }
      },
      //提交表单
      handleSubmit(callback) {
        this.$refs.form.submit({  }, callback)
      }
    },
    created() {
    },
    components: {}
  }
</script>

<style scoped lang="less" rel="stylesheet/less">

</style>
